/**
 * 
 */
package co.fitstart.market.service;

import com.demo2do.core.service.GenericService;

import co.fitstart.entity.user.User;
import co.fitstart.entity.user.UserAccount;
import co.fitstart.entity.user.WechatAccount;

/**
 * @author downpour
 * @author lute
 * @author mohanlan
 */
public interface UserService extends GenericService<User> {
    
    /**
     * 
     * @param mobile
     * @return
     */
    public User getUser(String mobile);
    
    /**
     * Get user by WeChat openid
     * 
     * @param openid
     * @return
     */
    public User getUserByOpenId(String openid);
    
    /**
     * 
     * @param name
     * @param value
     * @return 
     */
    public UserAccount getUserAccount(String name, String value);
    
    /**
     * create user account
     * 
     * @param userAccount
     * @param wechatAccount
     */
    public void createUserAccount(UserAccount userAccount, WechatAccount wechatAccount);
    
    /**
     * 
     * @param mobile
     * @param openid
     * @param accountId
     * @param isEmail
     * @return
     */
    public UserAccount login(String mobile, String openid, String accountId, boolean isEmail);
}
